package com.imooc.ad.Conf;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.smile.MappingJackson2SmileHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.List;

/**
 * Created byFengGuoXing  DATE:19-1-30 11:00
 */
@Configuration
public class WebConfiguration implements WebMvcConfigurer {


    @Override
    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
        converters.clear();
        //消息转换器：将java对象转换成Json
        converters.add(new MappingJackson2SmileHttpMessageConverter());

    }
}